Page({
    data: {
        href:"loading...", 
        id:null
      },
    onLoad: function (options) {

        this.setData({
          id:options.id
        })
        this.loadPage(this.data.id)
        console.log(options.id)
      },
    loadPage: function (options) { //加载数据渲染页面
        var _this=this;
          wx.request({
          url: 'https://wx.ichelaba.com/chelabaapi/index.php/selectpromotion/ajaxDetailForWx',//上线的话必须是https，没有appId的本地请求貌似不受影响
          data: {"id":this.data.id},
          method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
          // header: {}, // 设置请求的 header
          success: function(res){
                console.log(res)

              _this.setData({
                href:res.data.detail.link
              });
          },
          fail:function(){
          },
          complete: function(){
          }
        });
     }
 })